import type { AxiosRequestConfig, AxiosResponse } from 'axios';

// 请求拦截器类型
export interface RequestHookInterceptors<T = AxiosResponse> {
    requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
    requestInterceptorCatch?: (error: any) => any;
    responseInterceptor?: (res: T) => T;
    responseInterceptorCatch?: (error: any) => any;
}

export interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
    interceptors?: RequestHookInterceptors<T>;
    showLoading?: boolean;
}